export function initStorage<T>(key: string, val: T) {
	let v = window.localStorage.getItem(key);

	if (v == null) {
		window.localStorage.setItem(key, JSON.stringify(val));
		return val;
	} else {
		return JSON.parse(v) as T;
	}
}
